]> dgit.raspbian.org Git - gnome-shell.git/commit
telepathyClient: Use proper Object to wrap different tpl messages
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Fri, 20 Mar 2020 19:31:45 +0000 (20:31 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 25 Mar 2020 22:22:49 +0000 (22:22 +0000)
commit03a46be5c77797519ea01c2759fb0f9507944fa7
tree5570a17126746a114f126a1fdf0ad9e650fa6c33
parent9a26b970f9800edc9707c43a0a41e68e104f7496
telepathyClient: Use proper Object to wrap different tpl messages

In telepathyClient we consider messages both Tpl.TextEvents and
Tpl.Messages, and we manually create JS objects to copy the properties we
care for each one. This may lead to objects not matching the interface we
want.

Instead, use an object with construct-only properties and two factory static
methods to initialize it.

Unfortunately we need to use the ChatMessageClass for the class name or
calling the static methods would trigger a gjs error as per [1].

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1113

[1] https://gitlab.gnome.org/GNOME/gjs/-/issues/310
js/ui/components/telepathyClient.js